"use client"

import { List, Avatar } from "antd";
import Link from "next/link";
import { data } from "../app/article/data"

export default function ArticleList() {
    return (
        <List
            itemLayout="horizontal"
            dataSource={data}
            renderItem={(item, index) => (
                <Link href={`/article/${item.id}`}><List.Item>
                    <List.Item.Meta
                        className="!items-center"
                        avatar={<Avatar src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${index}`} />}
                        title={item.title}
                    />
                </List.Item></Link>

            )}
        />
    )
}
